<?php /* Smarty version Smarty-3.1.8, created on 2012-06-22 10:17:33
         compiled from ".\templates\guestbook.html" */ ?>
<?php /*%%SmartyHeaderCode:310304fcf6eb8da2e65-09209506%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '3216e58abb5b0067418f67186dd47e523b1ac63c' => 
    array (
      0 => '.\\templates\\guestbook.html',
      1 => 1339683747,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '310304fcf6eb8da2e65-09209506',
  'function' => 
  array (
  ),
  'version' => 'Smarty-3.1.8',
  'unifunc' => 'content_4fcf6eb8ef3223_74200258',
  'variables' => 
  array (
    'website_name' => 0,
    'templates_root' => 0,
    'guestbook_title' => 0,
    'guestbook_text' => 0,
    'msg_arr' => 0,
    'pageBar' => 0,
  ),
  'has_nocache_code' => false,
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_4fcf6eb8ef3223_74200258')) {function content_4fcf6eb8ef3223_74200258($_smarty_tpl) {?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo $_smarty_tpl->tpl_vars['website_name']->value;?>
</title>
<link href="<?php echo $_smarty_tpl->tpl_vars['templates_root']->value;?>
/style/style_pubilc.css" rel="stylesheet" type="text/css" />
<link href="<?php echo $_smarty_tpl->tpl_vars['templates_root']->value;?>
/style/style_guestbook.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<?php echo $_smarty_tpl->tpl_vars['templates_root']->value;?>
/script/jquery-1.7.1.js"></script>
<script type="text/javascript" src="<?php echo $_smarty_tpl->tpl_vars['templates_root']->value;?>
/script/pubilc.js"></script>
<script type="text/javascript" src="<?php echo $_smarty_tpl->tpl_vars['templates_root']->value;?>
/plugin/xheditor-1.1.12/xheditor-1.1.12-zh-cn.min.js"></script>
<!--[if IE 6]>
	<script src="//letskillie6.googlecode.com/svn/trunk/2/zh_CN.js"></script>
<![endif]-->

<script type="text/javascript">
$(document).ready(function(e) {
    $('#submit').click(function(e){
		var author_v = $('#author').val();
		var email_v = $('#email').val();
		var content_v = $('#content').val();
		switch (''){
			case author_v:
				alert('请写下你的大名~');
				return false;
				break;
			case email_v:
				alert('请留下你的email~');
				return false;
				break;
			case content_v:
				alert('留几句话吧~');
				return false;
				break;
			default:
				break;
			}
		$('.page_bar').load('guestbook_dl.php',{author:author_v,email:email_v,content:content_v}
			,function(){
				$('#ajax_mark').next(this).find('.guestbook_panel').eq(0).prepend('<div class="msg_item"><dl><dt><div class="l_title"><span>作者：</span>'+author_v+'</div></dt><dd>'+content_v+'</dd></dl></div>');
				alert('留言成功~！');

			});

		});
});

</script>

</head>

<body>
<div class="box"> <?php echo $_smarty_tpl->getSubTemplate ('header.tpl', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);?>

  <div class="main">
    <div class="main_top">
      <div class="main_icon">
        <div class="main_title">
          <h1><?php echo $_smarty_tpl->tpl_vars['guestbook_title']->value;?>
</h1>
        </div>
        <div class="main_text">
          <?php echo $_smarty_tpl->tpl_vars['guestbook_text']->value;?>

        </div>
      </div>
    </div>
    <div class="main_bottom">
      <div class="msg_list">
        <div class="main_b_title" id="ajax_mark">
          <h2>留言列表</h2>
        </div>
        <div class="guestbook_panel">
        <div class="guestbook_panel">
        <?php if (isset($_smarty_tpl->tpl_vars['smarty']->value['section']['key'])) unset($_smarty_tpl->tpl_vars['smarty']->value['section']['key']);
$_smarty_tpl->tpl_vars['smarty']->value['section']['key']['name'] = 'key';
$_smarty_tpl->tpl_vars['smarty']->value['section']['key']['loop'] = is_array($_loop=$_smarty_tpl->tpl_vars['msg_arr']->value) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$_smarty_tpl->tpl_vars['smarty']->value['section']['key']['show'] = true;
$_smarty_tpl->tpl_vars['smarty']->value['section']['key']['max'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['key']['loop'];
$_smarty_tpl->tpl_vars['smarty']->value['section']['key']['step'] = 1;
$_smarty_tpl->tpl_vars['smarty']->value['section']['key']['start'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['key']['step'] > 0 ? 0 : $_smarty_tpl->tpl_vars['smarty']->value['section']['key']['loop']-1;
if ($_smarty_tpl->tpl_vars['smarty']->value['section']['key']['show']) {
    $_smarty_tpl->tpl_vars['smarty']->value['section']['key']['total'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['key']['loop'];
    if ($_smarty_tpl->tpl_vars['smarty']->value['section']['key']['total'] == 0)
        $_smarty_tpl->tpl_vars['smarty']->value['section']['key']['show'] = false;
} else
    $_smarty_tpl->tpl_vars['smarty']->value['section']['key']['total'] = 0;
if ($_smarty_tpl->tpl_vars['smarty']->value['section']['key']['show']):

            for ($_smarty_tpl->tpl_vars['smarty']->value['section']['key']['index'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['key']['start'], $_smarty_tpl->tpl_vars['smarty']->value['section']['key']['iteration'] = 1;
                 $_smarty_tpl->tpl_vars['smarty']->value['section']['key']['iteration'] <= $_smarty_tpl->tpl_vars['smarty']->value['section']['key']['total'];
                 $_smarty_tpl->tpl_vars['smarty']->value['section']['key']['index'] += $_smarty_tpl->tpl_vars['smarty']->value['section']['key']['step'], $_smarty_tpl->tpl_vars['smarty']->value['section']['key']['iteration']++):
$_smarty_tpl->tpl_vars['smarty']->value['section']['key']['rownum'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['key']['iteration'];
$_smarty_tpl->tpl_vars['smarty']->value['section']['key']['index_prev'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['key']['index'] - $_smarty_tpl->tpl_vars['smarty']->value['section']['key']['step'];
$_smarty_tpl->tpl_vars['smarty']->value['section']['key']['index_next'] = $_smarty_tpl->tpl_vars['smarty']->value['section']['key']['index'] + $_smarty_tpl->tpl_vars['smarty']->value['section']['key']['step'];
$_smarty_tpl->tpl_vars['smarty']->value['section']['key']['first']      = ($_smarty_tpl->tpl_vars['smarty']->value['section']['key']['iteration'] == 1);
$_smarty_tpl->tpl_vars['smarty']->value['section']['key']['last']       = ($_smarty_tpl->tpl_vars['smarty']->value['section']['key']['iteration'] == $_smarty_tpl->tpl_vars['smarty']->value['section']['key']['total']);
?>
        <div class="msg_item">
          <dl>
            <dt>
                <div class="l_title"><span>作者：</span><?php echo $_smarty_tpl->tpl_vars['msg_arr']->value[$_smarty_tpl->getVariable('smarty')->value['section']['key']['index']]['author'];?>
</div>
            </dt>
            <dd><?php echo $_smarty_tpl->tpl_vars['msg_arr']->value[$_smarty_tpl->getVariable('smarty')->value['section']['key']['index']]['content'];?>
</dd>
          </dl>
        </div>
        <?php endfor; endif; ?>
        <div class="page_bar"><?php echo $_smarty_tpl->tpl_vars['pageBar']->value;?>
</div>
       	</div>
        <a id="bd_msg" href="javascript:;"><img src="<?php echo $_smarty_tpl->tpl_vars['templates_root']->value;?>
/images/msg_btn_05.png" width="142" height="46" /></a>
        <div class="edit_form">
        <form method="post">
          <table border="0" cellpadding="0" cellspacing="10">
            <tr>
              <td><label for="textfield">作者：</label>
                <input type="text" id="author" /></td>
              <td><label for="textfield2">Email：</label>
                <input type="text" id="email" />&nbsp;(将保密，不予显示)</td>
            </tr>
            <tr>
              <td colspan="2"><label for="textarea"></label>
                <textarea style="color:#FFF;" id="content" class="xheditor {tools:'mini',cleanPaste:3,internalStyle:false,inlineStyle:false}" cols="80" rows="7"></textarea></td>
            </tr>
            <tr>
              <td><input type="button" id="submit" value="发表留言" /></td>
              <td>&nbsp;</td>
            </tr>
          </table>
        </form>
      </div>
      	
        <script type="text/javascript">
        	$('#bd_msg').click(function(e) {
                $('.edit_form').animate({height:'toggle'},500);
            });
        </script>
        
      	</div>
      </div>

      <div class="clear"></div>
    </div>
  </div>
  <?php echo $_smarty_tpl->getSubTemplate ('footer.tpl', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);?>

</div>
</body>
</html>
<?php }} ?>